Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle semver metadata in version string #142

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

andyjayne
Copy link

@andyjayne andyjayne commented Nov 30, 2023

What

Update how version is parsed for pom files in the 'jar file to dependency' logic to cater for characters that are valid
in version strings but encoded in the file path.

For example, "+" encoded as "%2B".

The character is commonly used in semver version strings to add build metadata to the version. Per https://semver.org/

Why

Before this change 7.2.27+33-04a1ea9e-SNAPSHOT version string was not handled consistently and would result in different values in the declared/used compile dependencies. This meant that the plugin was not usable for dependencies with build metadata in their version string.

Fixes: #110

This test checks whether the plugin correctly handles
dependencies where the version contains a + character. The
character is commonly used in semver version strings to add
build metadata to the version. Per https://semver.org/

Currently this test fails as the plugin is comparing the
following version strings that do not match:

7.2.27+33-04a1ea9e-SNAPSHOT
7.2.27%2B33-04a1ea9e-SNAPSHOT

Reproduces: cb372#110
Update how version is parsed for pom files in the jar file
to dependency logic to to cater for characters that are valid
in version strings but encoded in the file path.
For example, "+" which is used for semver metadata, encoded as
"%2B".

Before this change 7.2.27+33-04a1ea9e-SNAPSHOT version string
was not handled consistently and would result in different
values in the declared/used compile dependencies.

Fixes: cb372#110
Copy link

@valydia valydia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Versions with characters in them show false positives
2 participants